@extends('main')

@section('tip', '标签分类')

@section('content')

<div class="row">
    <div class="col-md-9">
    <table class="table">
        <thead>
            <tr>
                <th>#</th>
                <th>标签名称</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
        @foreach($tags as $tag)
            <tr>
                <td>{{ $tag->id }}</td>
                <td>{{ $tag->name }}</td>
                <td>
                    <a href="{{ route('tag.show', $tag->id) }}" class="btn btn-default btn-sm"> 查看 </a>
                    <a href="{{ route('tag.edit', $tag->id) }}" class="btn btn-default btn-sm"> 修改 </a>
                </td>
            </tr>
        @endforeach
        </tbody>

    </table>
    </div>

    <div class="col-md-3">
        <div class="panel panel-default">
            <div class="panel-body">
                {!! Form::open(['route'=>'tag.store', 'method'=>'POST']) !!}
                {!! Form::label('name', 'tag名字:') !!}
                {!! Form::text('name', null, ['class'=>'form-control', 'style'=>'margin-bottom:8px']) !!}
                {!! Form::submit('创建新的标签', ['class'=>'btn btn-primary btn-block']) !!}
                {!! Form::close() !!}
            </div>
        </div>
    </div>
</div>

@endsection